#include "execution/expression_evaluator.h"
#include "execution/catalog.h"
#include "storage/buffer_pool.h"
#include "storage/disk_manager.h"
#include <iostream>
#include <string>
#include <cassert>
#include <memory>

void testBasicExpressionEvaluation() {
    std::cout << "Running basic expression evaluation test..." << std::endl;
    
    try {
        // 创建DiskManager
        auto diskManager = std::make_unique<DiskManager>("test.db");
        
        // 创建BufferPool
        auto bufferPool = std::make_unique<BufferPool>(10, std::move(diskManager));
        
        // 创建Catalog
        Catalog catalog(std::move(bufferPool));
        
        // 创建ExpressionEvaluator
        ExpressionEvaluator evaluator(catalog);
        
        std::cout << "All components created successfully" << std::endl;
        std::cout << "testBasicExpressionEvaluation passed!" << std::endl;
    } catch (const std::exception& e) {
        std::cerr << "Error in testBasicExpressionEvaluation: " << e.what() << std::endl;
        assert(false);
    }
}

int main() {
    std::cout << "Running expression evaluator tests..." << std::endl;
    
    testBasicExpressionEvaluation();
    
    std::cout << "All expression evaluator tests passed!" << std::endl;
    return 0;
}